import axios from 'axios';
import { useTokenStore } from '@/stores/token'; // 根据你的路径调整

const API_BASE_URL = '/api/patriarch'; // 根据实际的 API 路径进行调整

export const updateParentInfo = async (data, token) => {
    try {
        const response = await axios.put(`${API_BASE_URL}/update`, data, {
            headers: {
                Authorization: token // 传递 Token
            }
        });
        return response.data;
    } catch (error) {
        throw new Error('Error updating parent info');
    }
};
